ROOT_DIR=$(shell pwd)
SUBDIRS=$(shell ls -l | grep ^d | awk '{if($$9 != "debug") if($$9 != "include") print $$9}')

MKFILES		:= $(shell find -L ./ -name Makefile)
MKDIRS		:= ${patsubst %Makefile, %, $(MKFILES)}

all: tools
	@echo build all.

clean:  $(MKDIRS)
	@echo clean all.

$(MKDIRS):%:$(MKFILES)
	@echo "clean all."
	make -C $@ clean

tools:
	@make -C ./tools/make_image/

test:
	@echo $(ROOT_DIR)
	@echo $(SUBDIRS)
	@echo "This is test." 
	@echo $(MKFILES)

.PHONY: all clean tools tools_clean test
